GA

[OTIMIZADO] Atribute IsPokeball

Por Gabrieltxu, 25 de out. de 2017 em Linguagens de Programação

ispokeball
pda
server
gabrieltxu
4
2k
GabrieltxuG
25 de outubro de 2017 às 03:05

Olá galera, então estava vendo um codigo postado aqui pelo membro @Deadpool e vi que poderia ter otimizado e melhorado, eu fiz isso e estarei hoje postando para vocês, espero que gostem xD.

 

Algumas informações:

- O codigo foi criado para a source 0.3.6pl 

- O Código cria um novo Item_TYPE (POKEBALL)

- O Código cria um atributo chamado IsPokeball

- O Código seta tudo com o weight a 0

 

Código: 

 

Em Items.cpp encontre

 

levelDoor = 0;

e logo abaixo adicione 

 

isPokeball = false;

 

Agora encontre 

 

else if(tmpStrValue == "transformto")
			{
				if(readXMLInteger(itemAttributesNode, "value", intValue))
					it.transformToFree = intValue;
			}

 

E logo abaixo adicione 

 

else if(tmpStrValue == "weight")
				it.weight = 0;
			else if(tmpStrValue == "isPokeball")
            {
                it.slotPosition |= SLOTP_FEET;
				it.wieldPosition = SLOT_FEET;
                it.type = ITEM_TYPE_POKEBALL;
                 
                it.weight = 1000;
            }

Agora vamos em Items.h e procure por 

 

ITEM_TYPE_KEY,

e Logo abaixo adicione 

 

ITEM_TYPE_POKEBALL,

Agora abaixo de 

 

Ammo_t ammoType;

Adicione 

 

bool isPokeball;

E pronto agora só compilar e testar, agora para configurar no items.xml a pokebola devera ficar assim 

 

<item id="xxxx" article="a" name="pokeball ball"> 
          <attribute key="type" value="pokeball" />
          <attribute key="ispokeball" value="1"/>
    </item>

 

 

Espero que gostem galera xD

Editado Outubro 25 por Gabrieltxu

XarkisX
25 de outubro de 2017 às 11:07

O Que isso faz?

GabrieltxuG
25 de outubro de 2017 às 16:24
5 horas atrás, Xarkis disse:

O Que isso faz?

é um atributo que tem no PDA, com ele você coloca um item para só informar que é uma pokebola, mais nada kkk

3 anos depois...
KaboFlowK
12 de março de 2021 às 03:30
Em 25/10/2017 em 00:05, Gabrieltxu disse:

Olá galera, então estava vendo um codigo postado aqui pelo membro @Deadpool e vi que poderia ter otimizado e melhorado, eu fiz isso e estarei hoje postando para vocês, espero que gostem xD.

 

Algumas informações:

- O codigo foi criado para a source 0.3.6pl 

- O Código cria um novo Item_TYPE (POKEBALL)

- O Código cria um atributo chamado IsPokeball

- O Código seta tudo com o weight a 0

 

Código: 

 

Em Items.cpp encontre

 

levelDoor = 0;

e logo abaixo adicione 

 

isPokeball = false;

 

Agora encontre 

 

else if(tmpStrValue == "transformto")
			{
				if(readXMLInteger(itemAttributesNode, "value", intValue))
					it.transformToFree = intValue;
			}

 

E logo abaixo adicione 

 

else if(tmpStrValue == "weight")
				it.weight = 0;
			else if(tmpStrValue == "isPokeball")
            {
                it.slotPosition |= SLOTP_FEET;
				it.wieldPosition = SLOT_FEET;
                it.type = ITEM_TYPE_POKEBALL;
                 
                it.weight = 1000;
            }

Agora vamos em Items.h e procure por 

 

ITEM_TYPE_KEY,

e Logo abaixo adicione 

 

ITEM_TYPE_POKEBALL,

Agora abaixo de 

 

Ammo_t ammoType;

Adicione 

 

bool isPokeball;

E pronto agora só compilar e testar, agora para configurar no items.xml a pokebola devera ficar assim 

 

<item id="xxxx" article="a" name="pokeball ball"> 
          <attribute key="type" value="pokeball" />
          <attribute key="ispokeball" value="1"/>
    </item>

 

 

Espero que gostem galera xD

 

os source d PokeXtibia nao tenhe LevelDoor